package com.gklyj.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gklyj.mapper.zhanghaoMapper;
import com.gklyj.pojo.Zhanghao;
import com.gklyj.service.zhanghaoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional //实现事务的时候要在业务类中加入该注解
public class zhanghaoServiceImpl extends ServiceImpl<zhanghaoMapper,Zhanghao> implements zhanghaoService {

    @Autowired
    private zhanghaoMapper zhanghaoMapper;


    //登录验证，查询是否有该账号
    @Override
    public Zhanghao findZhangHao(Zhanghao zhanghao) {
        return zhanghaoMapper.findOneData(zhanghao);
    }

    @Override
    public Integer findZ_id(String username, String password) {
        return zhanghaoMapper.findIdByUsername_Password(username,password);
    }

    @Override
    public String findRoelbyUsername(String username) {
        return zhanghaoMapper.findRoleByUsername(username);
    }

    @Override
    public Zhanghao FindZhangHaoByUsername(String username) {
        return zhanghaoMapper.findZhangHaoByUsername(username);
    }
}
